package com.hangzhou.xyj.model;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yaohuix on 2016/3/2  17:02
 * <p/>
 * 动态Model
 */
public class DynamicModel implements Serializable {
    public static final int TYPE_TEXT = 2;
    public static final int TYPE_IMG = 3;
    public static final int TYPE_LISTEN = 4;
    private int id;//实体唯一标识
    @SerializedName("type")
    private int showType;//展示的类型
    private int realShowType;//实际展示的类型
    private List<String> imageList = new ArrayList<>();//图片列表
    private int commentNum;//评论数量
    private int transferNum;//转发数量
    private int listenNum;//听的数量
    private String userName;//用户名
    private String userHead;//用户头像Icon
    private String location;//地点
    private int h5Type;//是否是h5的动态。1：是h5；2：非h5
    @SerializedName("gmtCreate")
    private String createTime;//创建时间
    @SerializedName("createStr")
    private String createTime2;//我的收藏 我的评论的创建时间
    @SerializedName("goodNum")
    private int likeNum;//点赞数
    @SerializedName("user_type")
    private int type;//用户类型 ：1 是普通用户 2 是名家 3 是名团
    @SerializedName("check_flag")
    private int checkFlag;//认证标志：0 待审核 1 个人认证 2 团体认证 4 审核未通过
    private String content;//描述

    private String myComment;//我评论的内容
    private int fansNum;//粉丝数
    private String userTypeStr;//如：普通用户，认证个人，认证团体，名家，名团
    private boolean isFollow;//是否关注；true：已经关注；false表示没有关注
    @SerializedName("user_id")
    private int userId;//发布者的id
    private int collectId;//收藏的ID
    private int myCommentId;//我的评论的ID

    @SerializedName("userId")
    private int user_id;//我的收藏的特殊处理

    @SerializedName("name")
    private String songName;//戏剧名
    @SerializedName("pre_url")
    private String accompanyUrl; //伴奏
    @SerializedName("url")
    private String nativeUrl; //原唱url
    @SerializedName("sing_word")
    private String lrcUrl; //歌词url

    public DynamicModel() {
    }

    public DynamicModel(int myCommentId) {
        this.myCommentId = myCommentId;
    }

    /**
     * @param
     * @return
     * @Description 获取展示的样式
     * @author yaohuix
     * @date 2016/3/4 10:53
     */
    public int getRealShowType() {
        if (showType == 1) {
            return TYPE_LISTEN;
        } else if (showType == 2 && (getImageList() == null || getImageList().size() == 0)) {
            return TYPE_TEXT;
        } else {
            return TYPE_IMG;
        }
    }

    @Override
    public boolean equals(Object o) {
        return ((DynamicModel) o).getMyCommentId() == this.myCommentId;
    }

    @Override
    public String toString() {
        return "DynamicModel={type=" + type + "checkFlag=" + checkFlag + "}";
    }

    public int getMyCommentId() {
        return myCommentId;
    }

    public void setMyCommentId(int myCommentId) {
        this.myCommentId = myCommentId;
    }

    public int getH5Type() {
        return h5Type;
    }

    public void setH5Type(int h5Type) {
        this.h5Type = h5Type;
    }

    public int getCollectId() {
        return collectId;
    }

    public void setCollectId(int collectId) {
        this.collectId = collectId;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public boolean getIsFollow() {
        return isFollow;
    }

    public void setIsFollow(boolean isFollow) {
        this.isFollow = isFollow;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserTypeStr() {
        return userTypeStr;
    }

    public void setUserTypeStr(String userTypeStr) {
        this.userTypeStr = userTypeStr;
    }

    public int getFansNum() {
        return fansNum;
    }

    public void setFansNum(int fansNum) {
        this.fansNum = fansNum;
    }

    public String getCreateTime2() {
        return createTime2;
    }

    public void setCreateTime2(String createTime2) {
        this.createTime2 = createTime2;
    }

    public String getMyComment() {
        return myComment;
    }

    public void setMyComment(String myComment) {
        this.myComment = myComment;
    }

    public String getSongName() {
        return songName;
    }

    public void setSongName(String songName) {
        this.songName = songName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getShowType() {
        return showType;
    }

    public void setShowType(int showType) {
        this.showType = showType;
    }

    public int getCheckFlag() {
        return checkFlag;
    }

    public void setCheckFlag(int checkFlag) {
        this.checkFlag = checkFlag;
    }

    public int getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(int commentNum) {
        this.commentNum = commentNum;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public List<String> getImageList() {
        return imageList;
    }

    public void setImageList(List<String> imageList) {
        this.imageList = imageList;
    }

    public int getLikeNum() {
        return likeNum;
    }

    public void setLikeNum(int likeNum) {
        this.likeNum = likeNum;
    }

    public int getListenNum() {
        return listenNum;
    }

    public void setListenNum(int listenNum) {
        this.listenNum = listenNum;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public int getTransferNum() {
        return transferNum;
    }

    public void setTransferNum(int transferNum) {
        this.transferNum = transferNum;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getUserHead() {
        return userHead;
    }

    public void setUserHead(String userHead) {
        this.userHead = userHead;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getAccompanyUrl() {
        return accompanyUrl;
    }

    public void setAccompanyUrl(String accompanyUrl) {
        this.accompanyUrl = accompanyUrl;
    }

    public String getNativeUrl() {
        return nativeUrl;
    }

    public void setNativeUrl(String nativeUrl) {
        this.nativeUrl = nativeUrl;
    }

    public String getLrcUrl() {
        return lrcUrl;
    }

    public void setLrcUrl(String lrcUrl) {
        this.lrcUrl = lrcUrl;
    }
}
